From 427feacedcdc511fcead8d2289264aa58bafd038 Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Wed, 4 Oct 2023 15:34:39 +0700
Subject: set tier auth

---
 src/pages/shop/product/[slug].jsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'src/pages/shop/product/[slug].jsx')

diff --git a/src/pages/shop/product/[slug].jsx b/src/pages/shop/product/[slug].jsx
index 534aa8da..7351da2f 100644
--- a/src/pages/shop/product/[slug].jsx
+++ b/src/pages/shop/product/[slug].jsx
@@ -18,10 +18,11 @@ export async function getServerSideProps(context) {
   const cookies = context.req.headers.cookie
   const cookieObj = cookies ? cookie.parse(cookies) : {}
   const auth = cookieObj.auth ? JSON.parse(cookieObj.auth) : {}
+  const tier = auth.pricelist
   const authToken = auth?.token || ''
 
   let response = await axios(
-    `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/product-detail?id=` + getIdFromSlug(slug)
+    `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/product-detail?id=` + getIdFromSlug(slug) +'&auth=' + tier
   )
   let product = response.data
   // let productSolr = await productApi({ id: getIdFromSlug(slug), headers: { Token: authToken } })
-- 
cgit v1.2.3


From e9f65fadbfcf319db1f2f73e0984acad4f9aa505 Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Thu, 5 Oct 2023 10:35:30 +0700
Subject: error query params

---
 src/pages/shop/product/[slug].jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/pages/shop/product/[slug].jsx')

diff --git a/src/pages/shop/product/[slug].jsx b/src/pages/shop/product/[slug].jsx
index 7351da2f..63fb2e7e 100644
--- a/src/pages/shop/product/[slug].jsx
+++ b/src/pages/shop/product/[slug].jsx
@@ -18,7 +18,7 @@ export async function getServerSideProps(context) {
   const cookies = context.req.headers.cookie
   const cookieObj = cookies ? cookie.parse(cookies) : {}
   const auth = cookieObj.auth ? JSON.parse(cookieObj.auth) : {}
-  const tier = auth.pricelist
+  const tier = auth.pricelist ? auth.pricelist : false
   const authToken = auth?.token || ''
 
   let response = await axios(
-- 
cgit v1.2.3

